package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Salmb;
import com.clouds.wms.dao.SalmaDao;
import com.clouds.wms.dao.SalmbDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("salmbService")
public class SalmbServiceImpl implements SalmbService {
	@Resource(name="salmbDao")
	private SalmbDao salmbDao;
	@Resource(name="salmaDao")
	private SalmaDao salmaDao;

	@Override
	public PagesBean getSalmbList(String maaa, String maab, int offset,	int pageSize) throws SysException {
		return salmbDao.getSalmbList(maaa, maab, offset, pageSize);
	}

	@Override
	public int saveSalmb(Salmb salmb) throws SysException {
		return salmbDao.saveSalmb(salmb);
	}

	@Override
	public int getMaxMbac() throws SysException {
		return salmbDao.getMaxMbac();
	}

	@Override
	public int delSalmb(String mbaa, String mbab, String mbacs)	throws SysException {
		return salmbDao.delSalmb(mbaa, mbab, mbacs);
	}

	@Override
	public int updateSalmb(Salmb salmb) throws SysException {
		return salmbDao.updateSalmb(salmb);
	}

	@Override
	public int changeStatus(String mbaa, String mbab, String status)throws SysException {
		return salmbDao.changeStatus(mbaa, mbab, status);
	}

	@Override
	public void delSalmamb(String maaa, String maab) throws SysException {
		salmaDao.delSalmaByAaAb(maaa, maab);
		salmbDao.delSalmbByAaAb(maaa, maab);
	}

	@Override
	public void delSalmbAll(String maaa, String maab) throws SysException {
		salmbDao.delSalmbByAaAb(maaa, maab);
	}
}
